package demo1.utils;

import java.sql.Connection;
import java.sql.DriverManager;

public class connention {
    public Connection conn()throws Exception{
        Class.forName("com.mysql.cj.jdbc.Driver");
        //2.获取连接
        String url = "jdbc:mysql://127.0.0.1:3306/project2";
        String user = "root";
        String password = "111214Cjj";

        Connection conn = DriverManager.getConnection(url, user, password);
        return conn;
    }
}
